<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.22/dist/vue.js"></script>
    <script src="https://unpkg.com/vue-router@2.0.0/dist/vue-router.js"></script>
    <style>
      .head{
        background-color: orange;
          height: 80px;

      }
      *{
          padding: 0;
          margin: 0;
          border: 0;
      }
        .container{
            display:flex;
            height: 600px;
        }
        .left{
            background-color: aqua;
            flex: 2;
        }
        .main{
            background-color: blueviolet;
            flex: 8;
        }
    </style>
</head>
<body>
<div id="app">

    <router-view></router-view>
    <div class="container">
        <router-view name="left"></router-view>
        <router-view name="main"></router-view>
    </div>

</div>
<script>
    var header = {
        template: '<h1 class="head">header</h1>'
        ,data(){
            return {
                msg:'123'
            }
        }
        ,created(){
            console.log(this.$route.query.id)
        }
    };
    var left = {
        template: '<h1 class="left">left</h1>'
        ,data(){
            return {
                msg:'123'
            }
        }
        ,created(){
            console.log(this.$route.query.id)
        }
    };
    var main = {
        template: '<h1 class="main">main</h1>'
        ,data(){
            return {
                msg:'123'
            }
        }
        ,created(){
            console.log(this.$route.query.id)
        }
    };
    var ro=new VueRouter({
        routes:[
            {path:'/',components: {
                    'default': header
                    , 'left': left
                    , 'main': main
                }}

        ]
    })
    var vm = new Vue({
        el: '#app'
        , data: {}
        , methods: {}
        , router: ro
    });
</script>
</body>
</html>
